package com.framework.web.bus.repository;

import com.framework.web.bus.domain.GoodsInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
* @Title: Repository
* @Description: repository
* @author laowang
* @date 2016-09-11
* @version V1.0
*
*/
public interface GoodsInfoRepository extends JpaRepository<GoodsInfo, String>,
JpaSpecificationExecutor<GoodsInfo> {
    /**
     * 根据商品类别查询有效的商品
     * @param goodsTypeId
     * @param status
     * @return
     */
    public List<GoodsInfo> findByGoodsTypeIdAndStatus(String goodsTypeId,Integer status);

    /**
     * 根据商品类别id查询有效的商品，根据销量排序
     * @param goodsTypeId
     * @param status
     * @return
     */
    public List<GoodsInfo> findByGoodsTypeIdAndStatusOrderBySalesVolume(String goodsTypeId,Integer status);
}